<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>

    <meta charset="UTF-8">
<title><?php echo ($site_title); ?></title>
<meta name="keywords" content="<?php echo ($site_keywords); ?>" />
<meta name="description" content="<?php echo ($site_description); ?>">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="author" content="361dream">
 <?php echo hook('syncMeta');?>
<link href="http://cdn.amazeui.org/amazeui/2.4.2/css/amazeui.min.css" rel="stylesheet">

<link href="/ke361/Public/Home/css/nayiya.css" rel="stylesheet">
<link href="/ke361/Public/Home/images/favicon.ico" rel="icon" type="image/x-icon" />



   
    
</head>
<body>

	<!--[if lte IE 9 ]><div class="am-alert am-alert-danger ie-warning" data-am-alert>
	<button type="button" class="am-close">&times;</button>
	<div class="am-container">
		咿呀提醒：你的浏览器太古董了，咿呀无爱，<a
			href="http://browsehappy.com/" target="_blank">速速点击换一个</a>！</div></div><![endif]-->
<!-- 页头 -->
<header class="am-topbar">
	<h1 class="am-topbar-brand">
		<a id="header_logo" class="navbar-brand" href="/" title="<?php echo C('WEB_SITE_TITLE');?>" style="background-image:url('/ke361/Public/Home/images/<?php echo C('WEB_SITE_LOGO');?>')"></a>
	</h1>
    <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#doc-topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>
    <div class="am-collapse am-topbar-collapse" id="doc-topbar-collapse">
        <ul class="am-nav am-nav-pills am-topbar-nav">
	             <li >
	                   <a id="nav-00"  href="<?php echo U('Index/index');?>" target="_self">首页</a>
	             </li>	
				 <?php $__NAV__ = M('Channel')->field(true)->where("status=1")->order("sort")->select(); if(is_array($__NAV__)): $i = 0; $__LIST__ = $__NAV__;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$nav): $mod = ($i % 2 );++$i; if(($nav["pid"]) == "0"): ?><li >
	                            <a id="nav-<?php echo ($nav["id"]); ?>"  href="<?php echo (get_nav_url($nav["url"])); ?>" target="<?php if(($nav["target"]) == "1"): ?>_blank<?php else: ?>_self<?php endif; ?>"><?php echo ($nav["title"]); ?></a>
	                        </li><?php endif; endforeach; endif; else: echo "" ;endif; ?>
                  <?php if($config["SHOW_GOODS_CATEGORY"] == '1' ): if(!empty($category_goods_tree)): ?><li class="am-dropdown" data-am-dropdown>
			          <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;">商城 <span class="am-icon-caret-down"></span></a>
			          <ul class="am-dropdown-content">
			          	<?php if(is_array($category_goods_tree)): $i = 0; $__LIST__ = $category_goods_tree;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li><a href="<?php echo U('Goods/cate?id='.$vo['id']);?>"><?php echo ($vo['category_name']); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
			          </ul>
			       </li><?php endif; endif; ?>
	         </ul>

	        <form class="am-topbar-form am-topbar-left am-form-inline" role="search" action="<?php echo U('Search/index');?>" method="POST">
		        <div class="am-form-group">
		         	 <input type="text" name="keywords" id="keywords" class="am-form-field am-input-sm" value="<?php echo ($keyword); ?>" placeholder="请输入想找的宝贝...">
		        </div>
                <button type="submit" class="am-btn am-btn-primary">搜索</button>
		    </form>
            <div class="am-topbar-right">
                <?php if($my['uid'] > 0): ?><li class="am-dropdown" data-am-dropdown>
			          <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;"><?php echo ($my['username']); ?> <span class="am-icon-caret-down"></span></a>
			          <ul class="am-dropdown-content">	
			          		<li><a  href="<?php echo U('User/index');?>">个人主页</a></li>		       
			          		<li><a class="ajax-get" href="<?php echo U('User/logout');?>">退出</a></li>			          	
			          		
			          </ul>
			    </li>
                <?php else: ?>
                    <a class="am-btn am-btn-primary am-topbar-btn am-btn-sm" href="<?php echo U('User/login');?>" rel="nofollow">登录</a>
                    <a class="am-btn am-btn-primary am-topbar-btn am-btn-sm" href="<?php echo U('User/register');?>" rel="nofollow">注册</a><?php endif; ?>

            </div>
		</div>
	</nav>
</header>   
<!-- /页头 -->

	

	
	
	
<div class="am-container" >
    <div class="am-g topic-box">
        <div class="am-u-sm-8 topic-list">
            <?php if(is_array($_list)): $i = 0; $__LIST__ = $_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?><div class="item clear">
                       
	                        <div class="img">
	                        	<img class="lazy am-img-responsive" alt="<?php echo ($data["title"]); ?>" src="<?php echo (get_image_url($data["pic_url"])); ?>">
	                        </div>
	                         <a href="<?php echo U('/topic/'.$data['id']);?>">
		                        <div class="info">
		                        	 <h3 class="">
			                        	<?php echo ($data["title"]); ?>
			                        </h3>
	                            	<p class="discription"><?php echo ($data['subtitle']); ?></p>
		                        </div>
	                        </a>                
                    </div><?php endforeach; endif; else: echo "" ;endif; ?>
        </div>
        <div class="am-u-sm-4 hot-topic">
           
                <div class="headtitle">
                    <h3>热门专题</h3>
                </div>
              
				<div>
					<?php if(is_array($hot_topic)): $i = 0; $__LIST__ = $hot_topic;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?><div class="item">
							<a href="<?php echo U('/topic/'.$data['id']);?>">
								<div>
									<img class="lazy am-img-responsive" alt="<?php echo ($data["title"]); ?>" src="<?php echo ($data["pic_url"]); ?>">
								</div>
								<span><?php echo ($data["title"]); ?></span>
							</a>
						</div><?php endforeach; endif; else: echo "" ;endif; ?>
					
				
				</div>
            
        </div>
    </div>
    <?php if(!empty($_page)): ?><div class="am-g">
	    	<ul class="am-pagination"><?php echo ($_page); ?>
	  	 	</ul>
	       	<button id="next" class="am-btn am-btn-block" p="2" total-page="<?php echo ($total_page); ?>">
				点击加载更多
			</button>
	    </div><?php endif; ?>
</div>


	
	
	
	<!-- 页脚 -->


<div class="cart am-gotop-fixed">
    <a id="cart" href="<?php echo U('Cart/cart');?>" title="购物车">
        <span class="am-gotop-title">购物车</span>
        <i class="am-gotop-icon am-icon-shopping-cart"></i>
    </a>
    <span class="am-badge am-badge-primary am-round cart-number">0</span>
</div>
<div data-am-widget="gotop" class="am-gotop am-gotop-fixed" >
    <a href="#top" title="回到顶部">
        <span class="am-gotop-title">回到顶部</span>
        <i class="am-gotop-icon am-icon-chevron-up"></i>
    </a>
</div>
<!-- 信息提示框 -->
<div id="top-alert" class="am-fixed am-alert am-alert-danger" style="display: none;">
    <button class="am-close">&times;</button>
    <div class="am-alert-content">这是内容</div>
</div>
<div id="message" class="am-fixed am-message " style="display:none ;">
    <button class="am-close">&times;</button>
    <div class="am-alert-content">这是内容</div>
</div>
<footer class="am-footer ">

    <div class="row copyright">

        <span ><?php echo C('WEB_SITE_ICP');?></span><span>Copyright© 2014-2015 Powered by <a href="http://www.361dream.com">Ke361</a></span>
    </div>

</footer>
<?php echo C('TONGJI');?>
	
	
	<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="http://cdn.amazeui.org/amazeui/2.4.2/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="http://libs.baidu.com/jquery/2.0.3/jquery.min.js"></script>
<!--<![endif]-->
<script src="http://cdn.amazeui.org/amazeui/2.5.0/js/amazeui.min.js"></script>
<script src="/ke361/Public/static/jquery.lazyload.min.js"></script>
<script>
    var haveData                    =   true;
	$(function(){
 		$('.article-list>ul>li').hover(
				function(){
					$(this).css('box-shadow','0px 2px 8px 3px #ccc');
				},
				function(){
					$(this).css('box-shadow','');
				}
			
		);
		$('.goods-list .item').hover(
				function () {
					$(this).addClass('hover');
				}, function () {
					$(this).removeClass('hover');
				}
		);
		$('.like').hover(
				function () {
					$(this).find('i').removeClass('am-icon-heart-o').addClass('am-icon-heart');
				}, function () {
					$(this).find('i').removeClass('am-icon-heart').addClass('am-icon-heart-o');
				}
		);
 		$('#go-top').click(function(){
 			$('html, body').animate({scrollTop:0}, 'slow');
 			$('.side_right .con').hide();
 			return false;
 		}); 
 		$(window).scroll(function () {
 			if ($(window).scrollTop() > 500) {
 				$('.side_right .go-top').show();
 			}else{
 				$('.side_right .go-top').hide();
 			}


            if ($(window).scrollTop() == $(document).height() - $(window).height()) {
                nextPage();
            }
 		});
 		$('.icon-like').click(function(){
 			 id = $(this).attr('data-id');
 			 that = $(this);
 			 $.get("<?php echo U('Article/favor');?>",{'id':id},function(json){
 	            showmsg(json.info);
 	            if(json.status == 1){
 	            	that.addClass('like');	
 	            }else{
 	            	that.removeClass('like');	
 	            }
 	  	  	});  
 		});
 		$('.lazy').lazyload( {
			effect : "fadeIn",
		    failure_limit : 12 
		});
	});

	function favor(goodsid){
		$.get("<?php echo U('ajax/favor');?>",{id:goodsid},function(json){
				showmsg(json.info);
		})
	}

	function updateCart(){
		target = "<?php echo U('Cart/updateCart');?>";
		$.post(target).success(function(data){
			if(data.errno == 0){
				$('.cart-number').html(data.count);
			}
		});
	}
	function setCookie(name,value)
	{
		var Days = 30;
		var exp = new Date();
		exp.setTime(exp.getTime() + Days*24*60*60*1000);
		document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
	}
	function getCookie(name)
	{
		var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
		if(arr=document.cookie.match(reg))
			return unescape(arr[2]);
		else
			return null;
	}
(function(){
    var bp = document.createElement('script');
    bp.src = '//push.zhanzhang.baidu.com/push.js';
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script><script src="/ke361/Public/Home/js/nayiya.js"></script>

<script>
	$(function(){
		$('.topic-list .item').hover(
			function(){
				$(this).find('.info').show();
			},function(){
				$(this).find('.info').hide();
			}
		);
		
		highlight_subnav("<?php echo U('Topic/index');?>"); 
		$('#next').click(function(){
		  	LoadPage();  
		 }); 
	});
	function LoadPage(){
		
		var currentPage = $('#next').attr('p') ? $('#next').attr('p') : 1;
		$.get("<?php echo U('Topic/index');?>",{'p':currentPage},function(result){
			if(result.errno==0){
				$('.topic-list').append(result.content);
				$('#next').attr('p',result.p);
				if(result.p>$('#next').attr('total-page')){
					$('#next').html('木有了，亲');
					$('#next').attr('disabled',true);
					$('#next').addClass('disabled');
				}
			}
			
		},'json');	
	}
</script>






</body>
</html>